home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 8 / Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO / 034a / aecur101.arj / CONTRIB / CURSES / INC / PCVIDEO.H < prev    next >
C/C++ Source or Header  |  1990-03-10  |  5KB  |  150 lines

  1. /**********************************************************************
  2.  * 
  3.  * pcvideo.h
  4.  * 
  5.  * defines used by video functions
  6.  * 
  7.  * Copyright (c) 1988,89 J. Alan Eldridge
  8.  * 
  9.  *********************************************************************/
  10.  
  11. #ifndef __PCVIDEO__
  12.  
  13. #define __PCVIDEO__
  14.  
  15. /**********************************************************************
  16.  * 
  17.  *  physical screen size used by some low level functions
  18.  *
  19.  *********************************************************************/
  20.     
  21. #define VID_MAX_ROWS   25      /* size of physical screen */
  22. #define VID_MAX_COLS   80      /* this is used to create curscr */
  23.  
  24. /**********************************************************************
  25.  *  
  26.  *  arrow characters in IBM graphics char set 
  27.  *
  28.  *********************************************************************/
  29.     
  30. #define CH_UPARROW  24
  31. #define CH_DNARROW  25
  32. #define CH_LFARROW  27
  33. #define CH_RTARROW  26
  34.  
  35. /**********************************************************************
  36.  *  
  37.  *  defines for color video attributes
  38.  *
  39.  *********************************************************************/
  40.     
  41. #define VID_BLACK       0
  42. #define VID_BLUE        1
  43. #define VID_GREEN       2
  44. #define VID_CYAN        3
  45. #define VID_RED         4
  46. #define VID_MAGENTA     5
  47. #define VID_YELLOW      6
  48. #define VID_WHITE       7
  49.  
  50. #define VID_BLINK       8
  51. #define VID_BRIGHT      8
  52.  
  53. /**********************************************************************
  54.  *  
  55.  *  macro to create a video attribute from foreground, background colors
  56.  *  
  57.  *********************************************************************/
  58.  
  59. #define VID_ATTRIB(f,b) ((f) | ((b) << 4))
  60.  
  61. /**********************************************************************
  62.  *  
  63.  *  default attributes for Curses! windows
  64.  *  
  65.  *********************************************************************/
  66.  
  67. #define VID_DEFNORM     VID_ATTRIB(VID_WHITE,VID_BLACK)
  68. #define VID_DEFSTAND    VID_ATTRIB(VID_BLACK,VID_WHITE)
  69. #define VID_DEFBRIGHT   VID_ATTRIB(VID_WHITE|VID_BRIGHT,VID_BLACK)
  70.  
  71. /**********************************************************************
  72.  *  
  73.  *  constants for interfacing to video BIOS calls
  74.  *  
  75.  *********************************************************************/
  76.  
  77. #define VID_INTR            0x10    /* video BIOS interrupt # */
  78.  
  79. #define VB_SET_CURS_SIZE    0x01    /* "set cursor size" function # */
  80. #define VB_SET_CURS_POSN    0x02    /* "set cursor position" function # */
  81. #define VB_GET_CURS_INFO    0x03    /* "get cursor size & posn" function # */
  82.  
  83. #define VB_NO_CURSOR        0x2020  /* setting the starting & ending ... */
  84.                                     /* scan lines to 32 disables the cursor */
  85.  
  86. #define VB_SCROLL_WIN_UP    0x06    /* "scroll window up" function # */
  87.  
  88. #define VB_WRITE_CHRATT_STR 0x13    /* AT function to write char/attr string */
  89.  
  90. #define VB_NOFIX_CURSOR     0x02    /* leave cursor at beginning of string */
  91. #define VB_FIX_CURSOR       0x03    /* position cursor at end of string */
  92.  
  93. #define VB_WRITE_CHR_ATT    0x09    /* PC function to write 1 char/attr */
  94.  
  95. #define VB_GET_VID_MODE     0x0f    /* "get mode" function # */
  96.  
  97. #define VB_DISP_PAGE_0      0        /* DISP page to use (always 0) */
  98.  
  99. /**********************************************************************
  100.  *  
  101.  *  structures to hold a saved screen image + cursor info
  102.  *  
  103.  *********************************************************************/
  104.  
  105. /* 
  106.     the video BIOS returns cursor size and position packed 
  107.     in one word each ... these structs show the layout
  108. */
  109.     
  110. typedef struct {
  111.     UCHAR   bot;
  112.     UCHAR   top;
  113. } VID_CURS_SIZE;
  114.  
  115. typedef struct {
  116.     UCHAR   col;
  117.     UCHAR   row;
  118. } VID_CURS_POSN;
  119.  
  120. typedef struct {
  121.     VID_CURS_POSN   c_posn;
  122.     VID_CURS_SIZE   c_size;
  123.     VIDCHR          v_buff[VID_MAX_ROWS][VID_MAX_COLS];
  124. }   VID_SCR_BUFF;
  125.  
  126. #define VID_BUFF_SIZE   (VID_MAX_ROWS * VID_MAX_COLS * 2)
  127.  
  128. /**********************************************************************
  129.  *  
  130.  *  values for video modes returned by BIOS
  131.  *  
  132.  *********************************************************************/
  133.  
  134. #define VID_MONO_80x25      7
  135. #define VID_BandW_80x25     2
  136. #define VID_COLOR_80x25     3
  137.  
  138. /**********************************************************************
  139.  *  
  140.  *  values for video buffer addresses
  141.  *  
  142.  *********************************************************************/
  143.  
  144. #define VID_MONO_ADDR   0xb0000000L
  145. #define VID_COLOR_ADDR  0xb8000000L
  146.  
  147. #endif  /* __PCVIDEO__ */
  148.  
  149.  
  150.